home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 131 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.4 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.std.c
  4. Subject: Re: atexit() and return from main()
  5. Date: Wed, 17 Jan 96 23:57:54 GMT
  6. Organization: none
  7. Message-ID: <821923074snz@genesis.demon.co.uk>
  8. References: <4dhfja$j50@fg70.rz.uni-karlsruhe.de> <4diicg$i9e@lyra.csx.cam.ac.uk>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4diicg$i9e@lyra.csx.cam.ac.uk>
  15.            nmm1@cus.cam.ac.uk "Nick Maclaren" writes:
  16.  
  17. >In article <4dhfja$j50@fg70.rz.uni-karlsruhe.de>, ig25@fg70.rz.uni-karlsruhe.de
  18. > (Thomas Koenig) writes:
  19. >|> I don't see a problem when I replace the 'return 0' above with
  20. >|> an 'exit(0)'.
  21. >
  22. >I do.  exit() may unwind the stack before calling the atexit()
  23. >functions, and that is actually the way that most C run-time
  24. >systems implement close down.
  25.  
  26. Implementations that do that are non-conforming. According to 7.10.4.3:
  27.  
  28. "First, all functions registered by the atexit function are called, in
  29.  the reverse order of registration."
  30.  
  31. There is no license given to destroy any existing objects before that happens.
  32.  
  33. -- 
  34. -----------------------------------------
  35. Lawrence Kirby | fred@genesis.demon.co.uk
  36. Wilts, England | 70734.126@compuserve.com
  37. -----------------------------------------
  38.